<?php
$seo = YSEO::getSEO("{$node_name},{$model->keywords}", $model->title);
$this->pageTitle = $seo['title'];
$this->pageKeywords = $seo['keywords'];
$this->pageDescription = $seo['description'];

$this->breadcrumbs = YApp::generateAutoBreadcrumbs();
?>

<div id="box_large">
    <div id="top">
        <?php echo $node_name; ?>
    </div>
    <div id="body">
        <div id="body_main">
            <?php
            $this->renderPartial('_view', array(
                'data' => $model,
                'expand' => true
            ));
            ?>

            <div id="comments">
                <?php if ($model->commentCount >= 1): ?>
                <h3><?php echo $model->commentCount > 1 ? $model->commentCount . ' comments' : 'One comment'; ?></h3>

                <?php
                $this->renderPartial('_comments', array(
                    'post' => $model,
                    'comments' => $model->comments,
                ));
                ?>
                <?php endif; ?>

                <h3>添加评论</h3>

                <?php if (Yii::app()->user->hasFlash('commentSubmitted')): ?>
                <div class="success">
                    <?php echo Yii::app()->user->getFlash('commentSubmitted'); ?>
                </div>
                <?php
                else:
                    $this->renderPartial('/postComments/_form', array(
                        'model' => $comment,
                    ));
                endif;
                ?>
            </div><!-- comments -->
        </div>
    </div>
</div>